<%@ Control Language="c#" AutoEventWireup="True" Codebehind="FilterOptionControl.ascx.cs" Inherits="Votations.NSurvey.WebAdmin.UserControls.FilterOptionControl" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<%@ Import Namespace="Votations.NSurvey.WebAdmin" %>

<asp:label id=MessageLabel runat="server" ForeColor="Green" Visible="False"></asp:label>
<TABLE class=Innertext>
  <TR>
    <TD colSpan=2><font class=titleFont 
      ><asp:label id=filtertitle runat="server"></asp:label></FONT><br 
      ><IMG src="/Admin/Survey/images/linebreak.gif" > </TD></TR>
  <TR>
    <TD>&nbsp;&nbsp; </TD>
    <TD>
      <TABLE class=Innertext>
        <tr>
          <td noWrap width=140><STRONG 
            ><asp:literal id=FilterNameLabel runat="server" EnableViewState="False">Filter name :</asp:Literal></STRONG> </TD>
          <td width=480><asp:textbox id=FilterNameTextBox runat="server"></asp:textbox></TD></TR>
        <tr>
          <td width=140><STRONG 
            ><asp:literal id=RuleOperatorLabel 
             runat="server" 
            EnableViewState="False">Conditional rule operator 
            :</asp:Literal></STRONG> </TD>
          <td><asp:dropdownlist id=LogicalOperatorDropDownList runat="server"></asp:dropdownlist></TD></TR></TABLE></TD></TR></TABLE><asp:button id=UpdateFilterButton runat="server" Text="Update filter" onclick="UpdateFilterButton_Click"></asp:button><asp:button id=DeleteFilterButton runat="server" Text="Delete filter" onclick="DeleteFilterButton_Click"></asp:button><asp:button id=CreatefilterButton runat="server" Text="Create filter" onclick="CreatefilterButton_Click"></asp:button><asp:placeholder 
id=EditplaceHolder runat="server"><BR><BR><BR>
<TABLE class="Innertext">
  <TR>
    <TD colSpan="2"><FONT class="Titlefont"><asp:Literal id="NewRuleTitle" runat="server" EnableViewState="False">Add new rule to 
      filter</asp:Literal></FONT> <BR><IMG src="/admin/Survey/images/Linebreak.Gif"> </TD></TR>
  <TR>
    <TD>&nbsp;&nbsp; </TD>
    <TD>
      <TABLE class="Innertext">
        <TR>
          <TD noWrap width="140"><STRONG><asp:Literal id="QuestionLabel" runat="server" EnableViewState="False">Question 
            :</asp:Literal></STRONG> </TD>
          <TD width="480"><asp:dropdownlist id="QuestionFilterDropdownlist" runat="server" AutoPostBack="True" onselectedindexchanged="QuestionFilterDropdownlist_SelectedIndexChanged"></asp:dropdownlist></TD></TR>
        <TR>
          <TD width="140"><STRONG><asp:label id="AnswerLabel" runat="server">Answer :</asp:label></STRONG></TD>
          <TD><asp:dropdownlist id="AnswerFilterDropdownlist" runat="server" AutoPostBack="True" onselectedindexchanged="AnswerFilterDropdownlist_SelectedIndexChanged"></asp:dropdownlist></TD></TR>
        <TR>
          <TD width="140"><STRONG><asp:label id="FilterText" runat="server">Text contains :</asp:label></STRONG></TD>
          <TD><asp:textbox id="TextFilterTextbox" runat="server"></asp:textbox></TD></TR></TABLE></TD></TR></TABLE><asp:button id="AddRuleButton" runat="server" Text="Add new rule" onclick="AddRuleButton_Click"></asp:button><BR><BR><BR>
<TABLE class="Innertext">
  <TR>
    <TD colSpan="2"><FONT class="Titlefont"><asp:Literal id="FilterRulesTitle" runat="server" EnableViewState="False">Filter rules</asp:Literal></FONT> 
      <BR><IMG src="/admin/Survey/images/Linebreak.Gif"> </TD></TR>
  <TR>
    <TD>&nbsp;&nbsp; </TD>
    <TD>
      <TABLE class="Innertext">
        <TBODY>
        <TR>
          <TD noWrap width="700"><asp:repeater id="RulesRepeater" runat="server">
			<HeaderTemplate>
			<table border="0" cellpadding="4" cellspacing="3" class="InnerText" >
			</HeaderTemplate>
			<ItemTemplate>
				<tr><td>
<%#FormatRule(DataBinder.Eval(Container.DataItem,"QuestionText").ToString(), DataBinder.Eval(Container.DataItem,"AnswerText").ToString(), DataBinder.Eval(Container.DataItem,"TextFilter").ToString())%>
(<asp:LinkButton id="DeleteRuleLinkButton" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"FilterRuleID")%>' text='<%#((PageBase)Page).GetPageResource("DeleteRuleInfo")%>' runat="server"></asp:LinkButton>)</td></tr>
			</ItemTemplate>
			<AlternatingItemTemplate>
				<tr bgcolor="#F4F9FA"><td>
<%#FormatRule(DataBinder.Eval(Container.DataItem,"QuestionText").ToString(), DataBinder.Eval(Container.DataItem,"AnswerText").ToString(), DataBinder.Eval(Container.DataItem,"TextFilter").ToString())%>
(<asp:LinkButton id="Linkbutton1" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"FilterRuleID")%>' text='<%#((PageBase)Page).GetPageResource("DeleteRuleInfo")%>' runat="server"></asp:LinkButton>)</td></tr>
			</AlternatingItemTemplate>
			<FooterTemplate>
				</TABLE>
			</FooterTemplate>
			</asp:repeater></TD></TR></TABLE></TD></TR></TBODY></TABLE>
</asp:placeholder>
